package com.static_step.consultant.tools;

import com.static_step.consultant.service.impl.Reservation;
import com.static_step.consultant.service.impl.ReservationService;
import dev.langchain4j.agent.tool.P;
import dev.langchain4j.agent.tool.Tool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ReservationTool {
    @Autowired
    private ReservationService reservationService;

    // 工具1 添加预约信息
    @Tool("预约志愿填报服务")
    public void addReservation(
            @toolp
            @P("考生姓名") String name,
            @P("考生性别")String gender,
            @P("考生电话")String phone,
            @P("考生省份")String province,
            @P("预约时间，格式为 yyyy-MM-dd ")String communicationTime
    ) {
        Reservation reservation = new Reservation();
        reservationService.insert(reservation);
    }


    // 工具2 查询预约信息
    @Tool("根据考生手机号查询预约单")
    public Reservation findByPhone(
            @P("考生电话")String phone
    ) {
        return reservationService.findByPhone();
    }
}
